﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" />
    <link href="/CSS/V3/animate.css" rel="stylesheet" />
    <link href="/CSS/V3/style.css" rel="stylesheet" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.css?v=4.3.0" rel="stylesheet">
    <link href="/CSS/V3/BaseClassV3.css" rel="stylesheet" />
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/Scripts/bootstrap.js"></script>
    <script src="/JqueryPlug/laypage/laypage.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/jquery-migrate-1.1.0.min.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script src="/Scripts/jquery.qrcode.min.js"></script>
    <style>
        .faq-question {
            color: #808080;
        }

            .faq-question:hover {
                color: #808080;
            }


        .faq-answer {
            background: #FFFFFF;
        }

            .faq-answer:hover .btntool {
                visibility: visible;
            }

            .faq-answer .btntool {
                visibility: hidden;
            }

        .faq-item {
            padding: 5px;
        }

        .social-footer {
            border: none;
            background-color: #FFFFFF;
        }

        .panel-body {
            padding: 0px;
        }
    </style>
    <script>
        var model = avalon.define({
            $id: "CommonData",
            username: ComFunJS.getnowuser(),
            selGGType: "",
            curGGType: "",
            GGTypeData: [],
            CommonData: [],
            SearchContent: "",
            page: 0,
            totalCount: "",
            imgurl: "",
            GetGGDataList: function (type) {
                model.curGGType = type;
                $.getJSON('/API/FTAPI.ashx?Action=GETZXZXIST', { P1: model.curGGType, p: 1, P2: model.SearchContent }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.totalCount = resultData.Result1 == 0 ? "" : resultData.Result1; 
                        model.CommonData = resultData.Result;
                        model.selGGType = model.curGGType;
                        model.selSearContent = model.SearchContent;
                        laypage({
                            cont: 'pageDiv', //容器。值支持id名、原生dom对象，jquery对象。
                            pages: Math.ceil(parseInt(model.totalCount) * 1.0 / 8), //通过后台拿到的总页数
                            curr: 1, //初始化当前页
                            jump: function (e) { //触发分页后的回调
                                if (model.selGGType != model.curGGType || model.selSearContent != model.SearchContent) {
                                    e.curr = 1;
                                }
                                $.getJSON('/API/FTAPI.ashx?Action=GETZXZXIST', { P1: model.curGGType, p: e.curr, P2: model.SearchContent }, function (resultData) {
                                    model.CommonData = resultData.Result;
                                    model.selGGType = model.curGGType;
                                    model.selSearContent = model.SearchContent;
                                    model.totalCount = resultData.Result1;
                                })
                            }
                        });
                    }
                })

            },
            DELQYGG: function (Id, rowNumber) {
                parent.ComFunJS.winconfirm("确认要删除么", function () {

                    $.post("/API/FTAPI.ashx", { Action: "DELZXZXBYID", P1: Id }, function (result) {
                        var jsonresult = $.parseJSON(result)
                        if ($.trim(jsonresult.ErrorMsg) != "") {
                            ComFunJS.winwarning(jsonresult.ErrorMsg);
                        } else {
                            model.CommonData.remove(model.CommonData[rowNumber]);
                            parent.ComFunJS.winsuccess("删除成功");
                        }
                    })
                }, function () { })
            },
            HF: function (hfel) {
                parent.ComFunJS.winbtnwin("/ViewV3/APPBaseView/APP_ANSWER.html?ID=" + hfel.ID + "&r=" + Math.random(), "回复", 600, 400, {}, function (layero, index) {
                    var frameid = $("iframe", $(layero)).attr('id');
                    var hfnr = parent.window.frames[frameid].gethf();

                    if (hfnr.ID) {
                        hfel.hfList.push(hfnr);
                        parent.ComFunJS.winsuccess("回复成功");
                        parent.layer.close(index);
                    }
                })
            }
        });
        avalon.ready(function () {
            ComFunJS.initsetajax();
            var dom = window.location.protocol + '//' + window.location.host;
            $("#qrcode").qrcode({ width: 200, height: 200, text: dom + '/MobileView/UI/UI_KFGL_INPUT.html' });

            //获取主要菜单
            $.getJSON('/API/FTAPI.ashx?Action=GETZXZXXMIST', {}, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.GGTypeData = resultData.Result;
                }
            })

            $.post("/API/SZHLAPI.ashx?Action=GetUserInfo&r=" + Math.random(), {}, function (data) {

                var data = $.parseJSON(data);
                if (data.ErrorMsg == "") {
                    if (data.Result.QYinfo.FileServerUrl) {
                        var str = data.Result.QYinfo.FileServerUrl;
                        if (str.substr(str.length - 1, 1) != "/") {
                            str = str + "/";
                        }
                        model.imgurl = str;
                    }
                }
                model.GetGGDataList('');
            })
        })
    </script>
</head>
<body class="gray-bg " ms-controller="CommonData">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-3">
                <div class="float-e-margins">
                    <div class="ibox-content" style="border: 0; border-right: 1px solid #e7eaec;">
                        <div class="file-manager">
                            <div class="hr-line-dashed"></div>
                            <h5>项目：</h5>
                            <button class="btn  btn-sm" ms-class-1="btn-primary:model.curGGType==''" ms-class-2="btn-white:model.curGGType!=''" ms-click="GetGGDataList('')" type="button">全部</button>
                            <button class="btn  btn-sm" ms-class-1="btn-primary:item.Type==model.curGGType" ms-class-2="btn-white:item.Type!=model.curGGType" style="margin-right:5px;" type="button" ms-click="GetGGDataList(item.Type)" ms-repeat-item="GGTypeData">{{item.Type}}</button>
                            <div class="hr-line-dashed"></div>
                            <div class="clearfix"></div>
                            <h5>客户注册：</h5>
                            <div id="qrcode">
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-9">
                <div>
                    <div class="pull-right mail-search">
                        <div class="input-group">
                            <input type="text" class="input form-control" ms-duplex="SearchContent" placeholder="输入标题查询">
                            <span class="input-group-btn">
                                <button type="button" class="btn btn btn-primary" ms-click="GetGGDataList('')"> <i class="fa fa-search"></i> 搜索</button>
                            </span>
                        </div>
                    </div>
                    <h2>
                        在线咨询
                    </h2>
                    <div class="mail-tools tooltip-demo m-t-md">
                        <div class="btn-group pull-right">
                            <div id="pageDiv"></div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
                <div class="faq-item" ms-repeat-item="CommonData" style="">
                    <div class="panel-collapse  faq-answer" style="font-size:14px;border:0;border-bottom: 1px solid #e7eaec;">
                        <div class="row">
                            <div class="col-md-8">
                                <a class="btn btn-xs btn-danger pull-left">{{item.Type}}</a> <a data-toggle="collapse" id="phead" ms-attr-href="'#faq'+item.ID" ms-click="UpdateRead(item)" class="faq-question pull-left" style="margin-left:5px; font-weight:400;  font-size:16px;">{{item.Title}}</a>
                            </div>
                            <div class="col-md-4 text-right">

                                <a class="btn btn-danger btn-xs btntool" ms-click="DELQYGG(item.ID,$index)" style="margin-right:15px" ms-if="item.CRUser==username"><i class="fa fa-trash-o"></i> 删除 </a>
                                <a class="btndate">{{item.CRDate|date("yyyy-MM-dd")}}</a>
                                <a class="btn btn-white btn-xs" data-toggle="collapse" ms-attr-href="'#faq'+item.ID"><i class="fa fa-angle-down"></i> </a>
                            </div>
                        </div>
                        <div ms-attr-id="'faq'+item.ID" class="collapse social-footer" style="padding:10px 0">

                            <p ms-html="item.Description"></p>
                            <div style="margin-bottom:10px;margin-top:10px">
                                <span class="font-noraml">咨询人：<a>{{item.CRUserName}}</a></span>
                            </div>
                            <label ms-if="item.FileList.length>0"> 附件：</label><!--<a style="margin-left:10px" ms-repeat-files="item.FileList" target="_blank" download="filename" ms-attr-href="'/View/Common/DownLoadFile.aspx?MD5='+files.FileMD5">{{files.Name+'.'+files.FileExtendName}}</a>-->
                            <a ms-repeat-files="item.FileList" target="_blank" ms-attr-href="imgurl+files.FileMD5">
                                <img ms-attr-src="imgurl+'image/'+files.FileMD5" ms-if="ComFunJS.xstp(files.FileExtendName)" style="width:100px;height:100px;margin-bottom:10px" />
                            </a>
                            <a ms-repeat-fl="item.FileList" target="_blank" ms-attr-href="'/View/Common/DownLoadFile.aspx?MD5='+fl.FileMD5">
                                <img ms-attr-src="'/images/NewIndex/qywd/'+fl.FileExtendName+'.png'" ms-if="!ComFunJS.xstp(fl.FileExtendName)" style="width:100px;height:100px;margin-bottom:10px" />
                            </a>
                            <div class="social-comment" ms-repeat-el="item.hfList">
                                <span class="pull-left">
                                    <img alt="image" ms-attr-src="'/Upload/TX/'+el.CRUser+'.jpg'" onerror="javascript: this.src = '/images/TX/default.png'">
                                </span>
                                <div class="media-body">
                                    <span style="color: #3085DB;">
                                        {{el.CRUserName}}
                                    </span> {{el.HFContent}}
                                    <br ms-if="el.FileList.length>0" />
                                    <span ms-if="el.FileList.length>0"> 附件：</span><!--<a style="margin-left:10px" ms-repeat-files="el.FileList" target="_blank" download="filename" ms-attr-href="'/View/Common/DownLoadFile.aspx?MD5='+files.FileMD5">{{files.Name+'.'+files.FileExtendName}}</a>-->
                                    <a ms-repeat-files="el.FileList" target="_blank" ms-attr-href="imgurl+files.FileMD5">
                                        <img ms-attr-src="imgurl+'image/'+files.FileMD5" ms-if="ComFunJS.xstp(files.FileExtendName)" style="width:100px;height:100px;margin-bottom:10px" />
                                    </a>
                                    <a ms-repeat-fl="el.FileList" target="_blank" ms-attr-href="imgurl+fl.FileMD5">
                                        <img ms-attr-src="'/images/NewIndex/qywd/'+fl.FileExtendName+'.png'" ms-if="!ComFunJS.xstp(fl.FileExtendName)" style="width:100px;height:100px;margin-bottom:10px" />
                                    </a>
                                    <br />-
                                    <small class="text-muted">{{el.CRDate|date("MM月dd日 HH:mm")}}</small>
                                </div>
                            </div>

                            <div class="social-comment">
                                <button type="button" class="btn btn-xs btn-primary " ms-click="HF(item)">  回复</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
